Skip to content

Replace service request logs with metrics#117

Merged
arjunkomath merged 3 commits into
mainfrom
feat/service-level-metrics
Jul 9, 2026
Merged

Replace service request logs with metrics#117
arjunkomath merged 3 commits into
mainfrom
feat/service-level-metrics

Conversation

@techulus-agent

@techulus-agent techulus-agent commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Enable Traefik Prometheus metrics on a private loopback endpoint and have proxy agents forward those samples to VictoriaMetrics with server labels.
  • Add agent-side resource metrics for the techulus-cloud-agent process itself: CPU percent, memory percent, and RSS bytes.
  • Add service resource metrics for CPU, memory, and network usage, aggregated to stable service_id + server_id series.
  • Replace the service overview request-stats log aggregation API/UI with a metrics-only endpoint and chart modes for requests, latency, traffic, and resources.
  • Remove the VictoriaLogs request-stat aggregation path and tests.

Verification

  • go test ./... in agent
  • CI=true pnpm exec tsc --noEmit in web
  • CI=true pnpm test -- victoria-metrics-service-metrics.test.ts in web
  • CI=true pnpm exec biome check 'app/api/services/[id]/metrics/route.ts' components/service/details/service-details-overview.tsx lib/victoria-logs.ts lib/victoria-metrics.ts tests/victoria-metrics-service-metrics.test.ts in web
  • git diff --check -- agent web

Review Notes

  • Smart review found two parser issues in agent/internal/container/stats.go around stderr/JSON mixing and name-vs-ID attribution; both were fixed and covered with tests.
  • Basecamp review flagged churn-heavy container_id and deployment_id labels on service metrics; those labels were removed and container stats are now aggregated before export.
  • Smart review of agent-process metrics flagged CPU percent scale/test coverage; CPU is now normalized to 0-100 like node CPU, and arithmetic guard cases are covered.
  • Repo-wide Biome still has unrelated pre-existing diagnostics, so verification was scoped to files changed in this PR.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 1ee14b0.

@techulus-agent techulus-agent marked this pull request as ready for review July 9, 2026 04:54
@arjunkomath arjunkomath merged commit 9ea0ed0 into main Jul 9, 2026
11 checks passed
@arjunkomath arjunkomath deleted the feat/service-level-metrics branch July 9, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants